home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / asmbler.arc / DOS.INC < prev    next >
Text File  |  1988-11-19  |  9KB  |  175 lines

  1. ; Interrupt code and function codes for IBM PC DOS 2.0
  2. ; These are described in detail in Appendix D of the DOS Manual.
  3. ; [20-Jan-84] Nelson H.F. Beebe
  4.  
  5. $STDIN          EQU 00H ; Standard input file handle (redirectable)
  6. $STDOUT         EQU 01H ; Standard output file handle (redirectable)
  7. $STDERR         EQU 02H ; Standard error file handle (NOT redirectable)
  8. $STDAUX         EQU 03H ; Standard auxiliary device handle
  9. $STDPRT         EQU 04H ; Standard printer device handle
  10.  
  11. $VIDEO          EQU 10H ; Video input/output
  12.  
  13.         $VIDEO_SETMODE                  EQU 00H ; Set mode from AL
  14.         $VIDEO_SETCURSORTYPE            EQU 01H ; Set cursor type from CX
  15.         $VIDEO_SETCURSORPOSITION        EQU 02H ; Set cursor position 
  16.                                                 ; from DX,BH
  17.         $VIDEO_GETCURSORPOSITION        EQU 03H ; Get cursor position and mode
  18.                                                 ; into CX, CX
  19.         $VIDEO_GETLIGHTPENPOSITION      EQU 04H ; Get light pen position into
  20.                                                 ; BX,CH,DX
  21.         $VIDEO_SETPAGE                  EQU 05H ; Select active page from AL
  22.         $VIDEO_SCROLLUP                 EQU 06H ; Scroll active page up
  23.         $VIDEO_SCROLLDOWN               EQU 07H ; Scroll active page down
  24.         $VIDEO_GETATTRCHAR              EQU 08H ; Get attribute/character at    
  25.                                                 ; current cursor position
  26.         $VIDEO_SETATTRCHAR              EQU 09H ; Set attribute/character at    
  27.                                                 ; current cursor position
  28.         $VIDEO_SETCHAR                  EQU 0AH ; Set character at current
  29.                                                 ; cursor position
  30.         $VIDEO_SETCOLOR                 EQU 0BH ; Set color palette
  31.         $VIDEO_SETDOT                   EQU 0CH ; Set dot    
  32.         $VIDEO_GETDOT                   EQU 0DH ; Get dot
  33.         $VIDEO_SETTTY                   EQU 0EH ; Write teletype to active page
  34.         $VIDEO_GETVIDEOSTATE            EQU 0FH ; Get current video state
  35.         ; Video function codes for Quadram Quadscreen
  36.         $QS_SWITCHMODE                  EQU 10H ; Switch modes without erase
  37.         $QS_DESCRIBEMODE                EQU 11H ; Get width/height/font info
  38.         $QS_SCREENERASE                 EQU 12H ; Erase whole screen
  39.         $QS_MOVEDOT                     EQU 13H ; Move cursor to dot
  40.  
  41. $HALT           EQU 20H ; Program terminate ($DOS with $DOS_HALTKEEP or
  42.                         ; $DOS_EXIT are preferred)
  43.  
  44. $DOS            EQU 21H ; Function request
  45.  
  46. ; Function codes for INT $DOS
  47.  
  48. $DOS_HALT       EQU 00H ; Program terminate
  49. $DOS_CONIN      EQU 01H ; Standard Input to AL (echo to Standard Output)
  50. $DOS_CONOUT     EQU 02H ; Standard Output from DL
  51. $DOS_AUXIN      EQU 03H ; Auxiliary input to AL
  52. $DOS_AUXOUT     EQU 04H ; Auxiliary output from DL
  53. $DOS_PRTOUT     EQU 05H ; Printer output from DL
  54.  
  55. $DOS_DCONIO     EQU 06H ; Direct console I/O (no echo)
  56.         ; Flags for DL
  57.         $DOS_DCONIO_INPUT       EQU 0FFH        ; Input request
  58.         $DOS_DCONIO_OUTPUT      EQU 00H         ; Output request
  59.  
  60. $DOS_DCONIN     EQU 07H ; Direct console input (no echo)
  61. $DOS_CONIN2     EQU 08H ; Standard Input to AL (no echo)
  62. $DOS_STROUT     EQU 09H ; String out to Standard Output
  63. $DOS_BCONIN     EQU 0AH ; Buffered Standard Input
  64. $DOS_CONSTAT    EQU 0BH ; Standard Input status
  65. $DOS_CONFLUSH   EQU 0CH ; Flush Standard Input buffer then invoke
  66.                         ; function from code in AL
  67. $DOS_RESET      EQU 0DH ; Disk reset (and flush all file buffers)
  68. $DOS_SELECT     EQU 0EH ; Select drive
  69. $DOS_OPEN       EQU 0FH ; Open file
  70. $DOS_CLOSE      EQU 10H ; Close file
  71. $DOS_SFIRST     EQU 11H ; Search for first entry
  72. $DOS_SNEXT      EQU 12H ; Search for next entry
  73. $DOS_DELETE     EQU 13H ; Delete file
  74. $DOS_READ       EQU 14H ; Sequential Read from file
  75. $DOS_WRITE      EQU 15H ; Sequential Write from file
  76. $DOS_CREATE     EQU 16H ; Create file
  77. $DOS_RENAME     EQU 17H ; Rename file (or file group)
  78.                         ; 18H used internally by DOS
  79. $DOS_CURRENT    EQU 19H ; Current disk code to AL
  80. $DOS_SETDTA     EQU 1AH ; Set disk transfer address from DS:DX
  81. $DOS_GETATI     EQU 1BH ; Get allocation table information
  82. $DOS_GETATI2    EQU 1CH ; Get allocation table information for specific drive
  83.                         ; 1DH used internally by DOS
  84.                         ; 1EH used internally by DOS
  85.                         ; 1FH used internally by DOS
  86.                         ; 20H used internally by DOS
  87. $DOS_RREAD      EQU 21H ; Random read
  88. $DOS_RWRITE     EQU 22H ; Random write
  89. $DOS_FILESIZE   EQU 23H ; File size
  90. $DOS_SETRRF     EQU 24H ; Set random record field
  91. $DOS_SETINT     EQU 25H ; Set interrupt vector
  92. $DOS_CREATEPS   EQU 26H ; Create new program segment
  93. $DOS_RBREAD     EQU 27H ; Random block read
  94. $DOS_RBWRITE    EQU 28H ; Random block write
  95. $DOS_PARSE      EQU 29H ; Parse file name
  96. $DOS_GETDATE    EQU 2AH ; Get date in CX:DX
  97. $DOS_SETDATE    EQU 2BH ; Set date from CX:DX
  98. $DOS_GETTIME    EQU 2CH ; Get time in CX:DX
  99. $DOS_SETTIME    EQU 2DH ; Set time from CX:DX
  100. $DOS_VERIFY     EQU 2EH ; Set/Reset verify switch from DL,AL
  101.  
  102. ; Codes 2F through 57 are new with DOS Version 2.00
  103.  
  104. $DOS_GETDTA     EQU 2FH ; Get current disk transfer address to ES:BX
  105. $DOS_GETVERSION EQU 30H ; Get DOS version number to AX
  106. $DOS_HALTKEEP   EQU 31H ; Terminate process and keep resident
  107.                         ; 32H used internally by DOS
  108. $DOS_CTLBREAK   EQU 33H ; Ctl-Break check from/to AL,DL
  109.                         ; 34H used internally by DOS
  110. $DOS_GETINT     EQU 35H ; Get interrupt vector to ES:BX
  111. $DOS_GETFREE    EQU 36H ; Get disk free space
  112.  
  113. $DOS_SWITCH     EQU 37H ; Get/set current command-line switch character
  114.                         ; (undocumented, but used internally by DOS)
  115.         ; Control codes in AL for this function:
  116.         $DOS_SWITCH_GET EQU 0   ; Get switch character to DL
  117.         $DOS_SWITCH_SET EQU 1   ; Set switch character from DL
  118.  
  119. $DOS_COUNTRY    EQU 38H ; Return country-dependent information
  120. $DOS_MKDIR      EQU 39H ; Make a subdirectory
  121. $DOS_RMDIR      EQU 3AH ; Remove (delete) a subdirectory
  122. $DOS_CHDIR      EQU 3BH ; Change current directory
  123. $DOS_CREATE2    EQU 3CH ; Create and open a file returning handle in AX
  124.  
  125. $DOS_OPEN2      EQU 3DH ; Open a file
  126.         ; Control codes in AL for this function:
  127.         $DOS_OPEN2_READ         EQU 0   ; read only
  128.         $DOS_OPEN2_WRITE        EQU 1   ; write only
  129.         $DOS_OPEN2_READWRITE    EQU 2   ; read/write access
  130.  
  131. $DOS_CLOSE2     EQU 3EH ; Close a file (handle in BX)
  132. $DOS_READ2      EQU 3FH ; Read byte stream from file
  133. $DOS_WRITE2     EQU 40H ; Write byte stream to file
  134. $DOS_UNLINK     EQU 41H ; Delete file (maybe eventually like Unix unlink)
  135.  
  136. $DOS_LSEEK      EQU 42H ; Move file read/write pointer
  137.         ; Control codes in AL for this function
  138.         $DOS_LSEEK_BOF          EQU 0   ; offset relative to beginning of file
  139.         $DOS_LSEEK_CURRENT      EQU 1   ; offset relative to current position
  140.         $DOS_LSEEK_EOF          EQU 2   ; offset relative to end of file
  141.  
  142. $DOS_CHMOD      EQU 43H ; Change file mode
  143.  
  144. $DOS_IOCTL      EQU 44H ; I/O control for devices
  145.         ; Control codes in AL for this function:
  146.         $DOS_IOCTL_GETDEV       EQU 00H ; Get device information
  147.         $DOS_IOCTL_SETDEV       EQU 01H ; Set device information
  148.         $DOS_IOCTL_READ         EQU 02H ; Read bytes
  149.         $DOS_IOCTL_WRITE        EQU 03H ; Write bytes
  150.         $DOS_IOCTL_READ2        EQU 04H ; Read bytes from drive in BL
  151.         $DOS_IOCTL_WRITE2       EQU 05H ; Write bytes to drive in BL
  152.         $DOS_IOCTL_GETINPSTAT   EQU 06H ; Get input status
  153.         $DOS_IOCTL_GETOUTSTAT   EQU 07H ; Get output status
  154.  
  155. $DOS_DUP        EQU 45H ; Duplicate a file handle
  156. $DOS_FORCEDUP   EQU 46H ; Force a duplicate of a handle
  157. $DOS_GETDIR     EQU 47H ; Get current directory
  158. $DOS_MEMALLOC   EQU 48H ; Allocate memory
  159. $DOS_MEMFREE    EQU 49H ; Free memory
  160. $DOS_MEMMODIFY  EQU 4AH ; Modify memory allocation
  161. $DOS_EXEC       EQU 4BH ; Load or execute a program
  162. $DOS_EXIT       EQU 4CH ; Terminate a process with file close and return code
  163. $DOS_RETURNCODE EQU 4DH ; Get process return code in AX
  164. $DOS_FINDFIRST  EQU 4EH ; Find first matching file
  165. $DOS_FINDNEXT   EQU 4FH ; Find next matching file
  166.                         ; 50H used internally by DOS
  167.                         ; 51H used internally by DOS
  168.                         ; 52H used internally by DOS
  169.                         ; 53H used internally by DOS
  170. $DOS_GETVERIFY  EQU 54H ; Get verify state to AL
  171.                         ; 55H used internally by DOS
  172. $DOS_RENAME2    EQU 56  ; Rename a file (even across directories)
  173. $DOS_FILEDATETIME EQU 57        ; Get/Set file date and time
  174.                         ; 58H..FFH undefined at or before DOS 2.0
  175.